package com.example.mq.mqserver.mapper;

import com.example.mq.mqserver.core.Binding;
import com.example.mq.mqserver.core.Exchange;
import com.example.mq.mqserver.core.MSGQueue;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

import java.util.List;

@Mapper
public interface MetaMapper {
    // 核心建表方法
    void createExchangeTable();
    void createQueueTable();
    void createBindingTable();

    // 针对上述三个表, 提供插入和删除操作
    void insertExchange(@Param("exchange") Exchange exchange);
    void deleteExchange(@Param("exchangeName") String exchangeName);
    List<Exchange> selectAllExchanges();

    void insertQueue(@Param("queue") MSGQueue queue);
    void deleteQueue(@Param("queueName") String queueName);
    List<MSGQueue> selectAllQueues();

    void insertBinding(@Param("binding") Binding binding);
    void deleteBinding(@Param("binding") Binding binding);
    List<Binding> selectAllBindings();
}
